<%--
  Created by IntelliJ IDEA.
  User: acoffee
  Date: 2021/11/1
  Time: 16:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>图书详情</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/index.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
    <script src="${pageContext.request.contextPath}/js/getParam.js"></script>
    <script>
        $(function () {
            $.post("${pageContext.request.contextPath}/category/queryAllCategory", "", function (data) {
                var goodsType = $("#goodsType");
                var str = "";
                for (var i in data) {
                    str += '<li><a href="${pageContext.request.contextPath}/goods/queryPageByCid?cid=' + data[i].id + '&currentPage=1">' + data[i].name + '</a></li>'
                }
                goodsType.append(str);
            }, "json")
        })

        function joinCart() {
            //获取nums
            var nums = $("#buyNums").val();

            //获取gid
            var gid = $("#gid").val();

            $.post("${pageContext.request.contextPath}/cart/joinCart","gid="+gid+"&nums="+nums,function () {
                alert("添加成功！")
            })
        }


    </script>

    <style>
        #grade {
            height: 34px
        }

        #grade > ul {
            height: 18px
        }

        #grade > ul > li {
            margin: 0
        }
    </style>
</head>
<body class="index">
<div id="content"></div>
<div class="container">
    <%@ include file="/common/page_top.jsp" %>
<%--<div class="header" id="header">--%>
        <%--<h1 class="logo">--%>
            <%--<a title="" style="background: url(${pageContext.request.contextPath}/images/logo.png);" href="index.html">电子商务平台</a>--%>
        <%--</h1>--%>
        <%--<!-- <ul class="shortcut">--%>
            <%--<li class="first"><a href="ucenter/">个人中心</a></li>--%>
            <%--<li><a href="ucenter/">我的订单</a></li>--%>
        <%--</ul>--%>
        <%--<p class="loginfo">--%>


            <%--[<a href="login.html">登录</a> <a class="reg" href="register.html">免费注册</a>]--%>

        <%--</p> -->--%>
        <%--<ul class="shortcut">--%>
            <%--<li class="first"><a href="${pageContext.request.contextPath}/pages/personal.jsp">个人中心</a></li>--%>
            <%--<li><a href="myOrders.html">我的订单</a></li>--%>
        <%--</ul>--%>
        <%--<p class="loginfo">你好!17760990684[<a href="javaScript:logout()">安全退出</a>]</p></div>--%>
    <%--<div class="navbar">--%>
        <%--<ul id="goodsType">--%>
            <%--<li><a href="goods.html?gtid=0">首页</a></li>--%>
            <%--<!-- <li><a href="#">IT技术</a></li>--%>
            <%--<li><a href="#">小说文学</a></li>--%>
            <%--<li><a href="#">历史传记</a></li>--%>
            <%--<li><a href="#">生活</a></li>--%>
            <%--<li><a href="#">经营管理</a></li> -->--%>
            <%--<li><a href="goods.html?gtid=1">IT技术</a></li>--%>
            <%--<li><a href="goods.html?gtid=2">历史传记</a></li>--%>
            <%--<li><a href="goods.html?gtid=3">小说</a></li>--%>
            <%--<li><a href="goods.html?gtid=4">生活</a></li>--%>
            <%--<li><a href="goods.html?gtid=5">经营管理</a></li>--%>
        <%--</ul>--%>
        <%--<div class="mycart">--%>
            <%--<dl>--%>
                <%--<dt>--%>
                    <%--<a href="${pageContext.request.contextPath}/cart/queryAllByUid">购物车<b name="mycart_nums" id="mycart_nums">0</b>件--%>
                    <%--</a>--%>
                <%--</dt>--%>
                <%--<dd>--%>
                    <%--<a href="${pageContext.request.contextPath}/cart/queryAllByUid">去结算</a>--%>
                <%--</dd>--%>
            <%--</dl>--%>
            <%--<!--购物车浮动div 开始-->--%>
            <%--<div class="shopping" id="div_mycart" style="display: none;">--%>
                <%--<dl class="cartlist" id="shopcarDiv">--%>
                <%--</dl>--%>
            <%--</div>--%>

        <%--</div>--%>
    <%--</div>--%>
    <div class="searchbar">
        <div class="allsort">
            <a href="javascript:void(0);"></a>
            <!--总的商品分类-开始-->
            <ul class="sortlist" id="div_allsort" style="display: none">
                <li><h2><a href="goods.html?gtid=1">IT技术</a></h2></li>
                <li><h2><a href="goods.html?gtid=2">历史传记</a></h2></li>
                <li><h2><a href="goods.html?gtid=3">小说</a></h2></li>
                <li><h2><a href="goods.html?gtid=4">生活</a></h2></li>
                <li><h2><a href="goods.html?gtid=5">经营管理</a></h2></li>
            </ul>
        </div>
        <script>

        </script>

        <div class="searchbox">
            <input class="text" type="text" name="q" autocomplete="off" placeholder="" id="word"> <input
                class="btn" type="button" value="搜索" id="search-btn">

        </div>
        <%--<div class="hotwords">--%>
            <%--热门搜索：IT--%>
        <%--</div>--%>
    </div>

    <div class="wrapper clearfix">
        <div class="summary">
            <input type="hidden" value="${goods.id}" id="gid">
            <h2 id="title">${goods.name}</h2>
            <!--基本信息区域-->
            <ul id="infor">
                <li><span class="f_r light_gray">图书编号：<label id="data_goodsNo">${goods.goodsno}</label></span></li>
                <li id="priceLi">销售价：￥<b class="price red2"><span class="f30" id="real_price">${goods.salesPrice}</span></b></li>
                <li>市场价：￥
                    <del id="data_marketPrice">${goods.marketprice}</del>
                </li>
                <li>作者：${goods.author}</li>
                <li>出版社：${goods.publisher}</li>
                <li>出版时间：${goods.uptime}</li>
                <li>库存：现货<span>(<label id="data_storeNums">${goods.stock}</label>)</span></li>
            </ul>
            <div class="current">
                <dl class="m_10 clearfix">
                    <dt>购买数量：</dt>
                    <dd>
                        <input class="gray_t f_l" type="text" id="buyNums" value="1" maxlength="5">
                        <div class="resize">
                            <a class="add" id="add"></a> <a class="reduce" id="reduce"></a>
                        </div>
                    </dd>
                </dl>
                <input class="submit_buy" type="button" id="buyNowBtn" value="立即购买">
                <div class="shop_cart" style="z-index: 1">
                    <input class="submit_join" type="button" id="joinCarBtn" value="加入购物车" onclick="joinCart()">
                    <div class="shopping" id="product_myCart" style="display: none">
                        <dl class="cart_stats">
                            <dt class="gray f14 bold">
                                <a class="close_2 f_r" href="javascript:closeCartDiv();" title="关闭">关闭</a> <img
                                    src="${pageContext.request.contextPath}/images/front/right_s.gif" width="24"
                                    height="24" alt="">成功加入购物车
                            </dt>
                            <!-- <dd class="gray">
                                目前选购商品共<b class="orange" name='mycart_count'></b>件<span>合计：<b
                                    name='mycart_sum'></b></span>
                            </dd> -->
                            <dd>
                                <a class="btn_blue bold" href="cart?opr=view">进入购物车</a><a class="btn_blue bold"
                                                                                          href="javascript:void(0)"
                                                                                          onclick="closeCartDiv();">继续购物&gt;&gt;</a>
                            </dd>
                        </dl>
                    </div>
                </div>
            </div>
        </div>

        <div>
            <div class="pic_show"
                 style="width: 335px; height: 335px; position: relative; z-index: 5; padding-bottom: 5px;">
                <img src="${pageContext.request.contextPath}/${goods.image}"
                     title="${pageContext.request.contextPath}/${goods.name}"
                     style="border: none; width: 335px; height: 335px" id="pic">
            </div>
        </div>
    </div>

    <div class="wrapper clearfix container_2">
        <!--左边栏-->
        <div class="sidebar f_l">
            <!-- 				<div class="box m_10">
                <div class="title">购买本商品的用户还购买过</div>
                <div class="content">
                    <ul class="ranklist">
                        <li class="current"><a
                            href="/shop/index.php?controller=site&action=products&id=1"><img
                                width="58px" height="58px" src="/shop/"></a> <a
                            title="Java编程思想" class="p_name"
                            href="/shop/index.php?controller=site&action=products&id=1">Java编程思想</a>
                            <b>￥89.00</b></li>
                    </ul>
                </div>
            </div> -->
        </div>


    </div>
    <div class="help m_10">
        <div class="cont clearfix">
            <dl>
                <dt>
                    <a href="">购物指南</a>
                </dt>
                <dd>
                    <a href="">订单状态</a>
                </dd>
                <dd>
                    <a href="">购物流程</a>
                </dd>
            </dl>
            <dl>
                <dt>
                    <a href="">支付帮助</a>
                </dt>
                <dd>
                    <a href="">支付帮助</a>
                </dd>
                <dd>
                    <a href="">在线支付</a>
                </dd>
                <dd>
                    <a href="">货到付款</a>
                </dd>
            </dl>
            <dl>
                <dt>
                    <a href="">配送帮助</a>
                </dt>
                <dd>
                    <a href="">EMS/邮政普包</a>
                </dd>
                <dd>
                    <a href="">商品验货与签收</a>
                </dd>
                <dd>
                    <a href="">配送范围及运费</a>
                </dd>
            </dl>
            <dl>
                <dt>
                    <a href="">售后服务</a>
                </dt>
                <dd>
                    <a href="">售后服务</a>
                </dd>
                <dd>
                    <a href="">发票制度</a>
                </dd>
                <dd>
                    <a href="">退货说明</a>
                </dd>
                <dd>
                    <a href="">换货说明</a>
                </dd>
            </dl>
            <dl>
                <dt>
                    <a href="">帮助信息</a>
                </dt>
                <dd>
                    <a href="">友情链接</a>
                </dd>
                <dd>
                    <a href="">联系客服</a>
                </dd>
                <dd>
                    <a href="">找回密码</a>
                </dd>
                <dd>
                    <a href="">关于我们</a>
                </dd>
            </dl>
        </div>
    </div>
    <div class="footer">
        <p class="links">
            <a href="">关于我们</a>|<a href="">常见问题</a>|<a href="">安全交易</a>|<a href="">购买流程</a>|<a href="">如何付款</a>|<a
                href="">联系我们</a>|<a href="">合作提案</a>
        </p>
        <%--Copyright © 2015-2021 <a class="copyys" target="_blank" href="">蜀ICP备01000010号</a>--%>
    </div>
</div>

</body>
</html>